﻿Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Text
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls

Namespace DotNetNuke.Modules.ActiveForums.Controls
    <DefaultProperty("Text"), ToolboxData("<{0}:TopicViewer runat=server></{0}:TopicViewer>")> _
    Public Class TopicNavigator
        Inherits ForumBase

        Private _itemTemplate As DisplayTemplate
        Public Property ItemTemplate() As DisplayTemplate
            Get
                Return _itemTemplate
            End Get
            Set(ByVal Value As DisplayTemplate)
                _itemTemplate = Value
            End Set
        End Property
        Private _headerTemplate As DisplayTemplate
        Public Property HeaderTemplate() As DisplayTemplate
            Get
                Return _headerTemplate
            End Get
            Set(ByVal Value As DisplayTemplate)
                _headerTemplate = Value
            End Set
        End Property
        Private _footerTemplate As DisplayTemplate
        Public Property FooterTemplate() As DisplayTemplate
            Get
                Return _footerTemplate
            End Get
            Set(ByVal Value As DisplayTemplate)
                _footerTemplate = Value
            End Set
        End Property
        Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
            Dim tb As New Controls.TopicViewer

            tb.PortalId = PortalId
            tb.ModuleId = ForumModuleId
            tb.TabId = ForumTabId
            tb.PageIndex = PageId
            tb.PageSize = MainSettings.PageSize
            tb.Template = ItemTemplate.Text
            'tb.HeaderTemplate = HeaderTemplate.Text
            'tb.FooterTemplate = FooterTemplate.Text
            tb.TopicId = TopicId
            tb.TimeZoneOffset = TimeZoneOffset
            writer.Write(tb.Render())
        End Sub

    End Class
End Namespace

